def ascending_list_insert(ascending_list, val):
    idx = 0
    for i in ascending_list:
        if i >= val:
            break
        idx = idx + 1
    ascending_list.insert(idx, val)


def descending_list_insert(descending_list, val):
    for idx in range(len(descending_list)):
        if descending_list[idx] <= val:
            descending_list.insert(idx, val)
            return
    descending_list.insert(len(descending_list), val)


def ordered_list_insert(some_list, val):
    if some_list[0] < some_list[-1]:
        ascending_list_insert(some_list, val)
    else:
        descending_list_insert(some_list, val)


a_list = [1, 3, 5, 7, 9, 11, 13]
another_list = sorted(list, reverse=True)

print('Ascending list:', a_list)
print('Descending list:', another_list)

some_val = int(input("Enter a number: "))

ordered_list_insert(a_list, some_val)
print('After inserting {}: '.format(some_val), a_list)

ordered_list_insert(another_list, some_val)
print('After inserting {}: '.format(some_val), another_list)
